create or replace view vac_branch_4_1 as
with br as
 (
  select
  workspace,
  application_id,
  application_name,
  page_id,
  page_name,
  branch_action,
  branch_point,
  when_button_pressed,
  branch_type,
  to_char(process_sequence) process_sequence,
  condition_type,
  condition_expression1,
  condition_expression2,
  save_state_before_branch,
  build_option,
  authorization_scheme,
  authorization_scheme_id,
  last_updated_by,
  last_updated_on,
  component_comment,
  branch_id,
  branch_when_button_id
  from APEX_APPLICATION_PAGE_BRANCHES
 )
select
  workspace,
  application_id,
  application_name,
  page_id,
  page_name,
  authorization_scheme_id,
  branch_when_button_id,
  branch_point,
  process_sequence,
  last_updated_by,
  last_updated_on,
  u_value,
  u_name,
  'APEX_APPLICATION_PAGE_BRANCHES' src_view_name
from br
 UNPIVOT INCLUDE NULLS ( u_value
   FOR    u_name
   IN
   (
      branch_action,
      when_button_pressed,
      branch_type,
      condition_type,
      condition_expression1,
      condition_expression2,
      save_state_before_branch,
      build_option,
      authorization_scheme,
      component_comment
   )
 );

